home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Virtual User 1.0 / Example Scripts / ItemTracer.vu < prev    next >
Text File  |  1991-01-25  |  2KB  |  56 lines

  1. #
  2. #    File:        ItemTracer.vu
  3. #
  4. #    Contains:    This script traces the rectangle of the frontmost window and then traces the 
  5. #                owning rectangle of each of the content items in the frontmost window (which
  6. #                VU can see).  It prints out each content item's descriptor just before tracing 
  7. #                its rectangle.  This script is not generally useful in the sense of testing an
  8. #                application but it is useful in showing you what content items VU can see in a 
  9. #                window and where it thinks they are.
  10. #
  11. #    Conventions:    Global variables begin with a capital letter
  12. #
  13. #    Written by:    Jay Jessen
  14. #
  15. #    Copyright:    © 1990 by Apple Computer, Inc., all rights reserved.
  16. #
  17. #    Change History:
  18. #
  19. #        5/17/90        JAS                A few formatting changes, name change to ItemTracer.vu        
  20. #        
  21. #        4/3/89           Jay Jessen        creation 
  22. #
  23. #    To Do:
  24. #
  25.  
  26.  
  27. task trace_rect(rect,speed_of_movement) begin
  28.     old_speed := mouseSpeed(speed_of_movement);
  29.     move absolute: { rect[1],rect[2] };
  30.     move absolute: { rect[3],rect[2] };
  31.     move absolute: { rect[3],rect[4] };
  32.     move absolute: { rect[1],rect[4] };
  33.     move absolute: { rect[1],rect[2] };
  34.     mouseSpeed(old_speed);
  35. end;
  36.  
  37.  
  38. #####   EXECUTION STARTS HERE  ######
  39.  
  40. The_mouse_speed := 2;
  41. Initial_wait    := 3;
  42.  
  43. move absolute: { 0, 0 };
  44. wait(Initial_wait);
  45. if match[window t:?Wind_title o:1 r:?Rect k: ?Contents_list]! begin
  46.     trace_rect(Rect,The_mouse_speed); # traces the window with the mouse
  47.     println "∂nwindow:  ",Wind_title;
  48.     print "=========";
  49.     for i := 1 to card(Wind_title) print "=";
  50.     println;
  51.     for each Content_item in Contents_list begin
  52.         println Content_item;
  53.         trace_rect(Content_item.rect,The_mouse_speed);
  54.     end;
  55. end;
  56.